/*
 * Project Name: tennis
 * $Id:  IBaseDAO.java 2016-05-13 14:35:00 $
 */
package org.aceor.tennis.dao;

import org.aceor.tennis.common.domain.BaseDomain;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface IBaseDAO<T extends BaseDomain> {
    public int insert(T paramT);

    public int update(T paramT);

    public int updateMap(@Param("map") Map<String, Object> paramMap);

    public int updateByCondition(
            @Param("update") Map<String, Object> paramMap1,
            @Param("condition") Map<String, Object> paramMap2);

    public int insertMap(@Param("map") Map<String, Object> paramMap);

    public int updateNull(T paramT);

    public int deleteById(Long paramLong);

    public int deleteByCondition(Map<String, Object> paramMap);

    public int deleteByProperty(@Param("property") String paramString,
                                         @Param("value") Object paramObject);

    public T fetch(Long paramLong);

    public T findOne(@Param("property") String paramString1,
                              @Param("value") Object paramObject,
                              @Param("orderBy") String paramString2,
                              @Param("sortBy") String paramString3);

    public List<T> findList(@Param("property") String paramString1,
                                     @Param("value") Object paramObject,
                                     @Param("orderBy") String paramString2,
                                     @Param("sortBy") String paramString3);

    public List<T> findAll(@Param("orderBy") String paramString1,
                                    @Param("sortBy") String paramString2);

    public List<T> queryPage(
            @Param("condition") Map<String, Object> paramMap,
            @Param("offset") int paramInt1, @Param("rows") int paramInt2,
            @Param("orderBy") String paramString1,
            @Param("sortBy") String paramString2);

    public List<T> like(
            @Param("condition") Map<String, Object> paramMap,
            @Param("orderBy") String paramString1,
            @Param("sortBy") String paramString2);

    public List<T> queryList(
            @Param("condition") Map<String, Object> paramMap,
            @Param("orderBy") String paramString1,
            @Param("sortBy") String paramString2);

    public T queryOne(
            @Param("condition") Map<String, Object> paramMap,
            @Param("orderBy") String paramString1,
            @Param("sortBy") String paramString2);

    public int count(@Param("condition")Map<String, Object> paramMap);

    public Long selectMaxId();

    public T updateOrSave(@Param("condition") T paramT,
                                   @Param("condition") Long paramLong);

    public T selectOne(@Param("condition") String paramString,
                                @Param("condition") Object paramObject);

    public List<T> selectList(@Param("condition") String paramString,
                                       @Param("condition") Object paramObject);

    public Class<T> getEntityClass();
}
